package com.vq.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.vq.entity.Trends;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TrendsMapper extends BaseMapper<Trends> {
    @Delete("delete from trends where id=#{id} and account=#{account}")
    void deleteByAccountAndId(String account, int id);


    /**
     * 查询共有多少条数据
     * @return
     */
    @Select("select count(id) from trends")
    Integer count();
    /**
     * 查询指定字段
     * @param begin
     * @param end
     * @return
     */
    List<Trends> selectLimit(Integer begin, Integer end);
    /**
     * 从后往前多少条数据
     * @param limit
     * @return
     */
    List<Trends> selectLimitToEnd(Integer limit);
}
